Disable Password Change Option From WordPress

How To Disable Password Change Option From WordPress

When you forgot WordPress admin password, you could change it from the login page.

Have you ever thought to turn off password recovery option from your WordPress login page? It can be another plus point for WordPress security.

It’s possible that someone can hack your email ID and it would be easy to recover the password of your website using that.

Wouldn’t it be great if you totally disable password change option from WordPress login panel?

Follow The Guide To Remove The Password recovery option.

As you all know, there are many files and folders present in your WordPress directory from which you have to open functions.php file from your theme.

All the functions are controlled by this file.

Whether you use the cPanel or you can directly open this file from WordPress admin panel.

Go to Appearance>>Editor>>functions.php file.

In most of the WordPress themes, the functions.php file consists every code from adding a new sidebar to the footer.

But here you just have to add the code below in the file.

function disable_password_change() { return false; }

add_filter ( ‘allow_password_reset’, ‘disable_password_change’ );

This simple code will disable the password recovery option. When someone tries to reset the password, a notification will appear that password change is not possible.

After adding this code, you can check on your own website.

Just open the login page and try to reset the password. After filling the email ID, you won’t be approved to change the password.

It’s another way to more secure your WordPress login panel.

Did It Work For You? Do You Have Anything To Say About It?

Most of the people fret when they think about the WordPress codes.

But as you can see the code is simple. If you have a little bit of knowledge about WordPress functions then you can change the name of the function shown above.

In your WordPress theme, you would find the similar kind of codes. The above-shown code will help you to disable password change option from WordPress.

If you still have anything to say, feel free to share your ideas.

by Ravi Chahar

A WordPress Professional and the LinkedIn Influencer. A coder by passion and a blogger by choice. WordPress theme development is his forte. He is your WordPress guy who will teach you how to solve WordPress errors, WordPress security issues, design issues and what not.


Get Free Updates Into Your Inbox

Learn Everything Just Like I Did

SUBSCRIBE



One Comment

  1. Hello, Ravi!

    Wonderful post as always, buddy!

    I believe that is the good tactic to stop changing the password for the users, and mainly in the event of the hacking attempt trying to gain the access of the users.

    You’re always ahead to make our life easier to manage our WordPress blogs! ?

    Thank you for that!

    ~ Adeel

Leave a Reply

Your email address will not be published. Required fields are marked *